import Vue from 'vue'
import App from './App.vue'
import router from './router'
import VueRouter from 'vue-router'
import store from './store'
import '@/mock/index.js'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './styles/index.scss'
// import VScaleScreen from 'v-scale-screen';
// import NProgress from 'nprogress' // 引入nprogress插件
// import 'nprogress/nprogress.css'  // 这个nprogress样式必须引入

import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts

import componentsTools from '@/components/index.js'
Vue.use(componentsTools)

import dayjs from 'dayjs'
Vue.prototype.$dayjs = dayjs

// 解决缩放问题  m是获取的当前屏幕的缩放比，在通过zoom属性对应缩放
import { detectZoom } from '@/utils/detectZoom.js'
// 处理笔记本系统默认系统比例为150%带来的布局影响
const m = detectZoom()
if (window.screen.width * window.devicePixelRatio >= 3840) {
  document.body.style.zoom = 100 / (Number(m) / 2) // 屏幕为 4k 时
} else {
  document.body.style.zoom = 100 / Number(m)
}


// 防止使用zoom引发下拉框面板偏移，主要是分页的组件
import fixZoom from './utils/fix-zoom'
Vue.use(fixZoom)  

// 如果确定是1920，那么就这两行代码就能搞定
// const s = window.screen.width / 1920;
// document.body.style.zoom = s;

Vue.use(ElementUI)

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
